
<html>
<head>
<title>SPL - Resultados da Consulta</title>
 <g:if test="${tipoUsuario == 'Admin'}">
        	<meta name="layout" content="adminBiblioteca" />
        </g:if>
        <g:else>
        	<meta name="layout" content="usuarioBiblioteca" />
        </g:else>
</head>
<body>
<h1>Resultados da Consulta</br>
</h1>
<div class="list">
<div align="center">
<h1>Emprestimo</h1>
</br>
</div>
<table>
	<thead>
		<tr>

			<g:sortableColumn property="titulo"
				title="${message(code: 'emprestimo.titulo.label', default: 'Titulo')}"
				params="${params}" />

			<g:sortableColumn property="tipo"
				title="${message(code: 'emprestimo.tipo.label', default: 'Tipo')}"
				params="${params}" />

			<g:sortableColumn property="login"
				title="${message(code: 'emprestimo.login.label', default: 'Login')}"
				params="${params}" />

			<g:sortableColumn property="dataEmprestimo"
				title="${message(code: 'emprestimo.dataEmprestimo.label', default: 'Data de Emprestimo')}"
				params="${params}" />

			<g:sortableColumn property="dataDevolucao"
				title="${message(code: 'emprestimo.dataDevolucao.label', default: 'Data de Devolucao')}"
				params="${params}" />

			<g:sortableColumn property="idItem" title="Detalhes" />

		</tr>
	</thead>
	<tbody>
		<g:each in="${pesquisaEmprestimo}" status="i" var="emprestimoInstance">
			<tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

				<td>
				${fieldValue(bean: emprestimoInstance, field: "titulo")}
				</td>

				<td>
				${fieldValue(bean: emprestimoInstance, field: "tipo")}
				</td>
				
				<td>
				${fieldValue(bean: emprestimoInstance, field: "login")}
				</td>

				<td>
				${fieldValue(bean: emprestimoInstance, field: "dataEmprestimo")}
				</td>
				
				<td>
				${fieldValue(bean: emprestimoInstance, field: "dataDevolucao")}
				</td>

				<td class="actionButtons"><span class="actionButton"> <g:link
					action="show" id="${emprestimoInstance.idItem}">
                              Ver mais
                            </g:link></span></td>

			</tr>
		</g:each>
	</tbody>
</table>
</div>


<div class="paginateButtons"><g:paginate
	total="${pesquisaEmprestimo.count()}" /></div>

<g:jasperReport action="createReportEmprestimoSimple" controller="emprestimo"
	format="PDF" jasper="Relatorio SPL - Emprestimo Simples"
	name="Relatorio SPL - PDF" />
<g:jasperReport action="createReportEmprestimoSimple" controller="emprestimo"
	format="XLS" jasper="Relatorio SPL - Emprestimo Simples"
	name="Relatorio SPL - XLS" />
<g:jasperReport action="createReportEmprestimoSimple" controller="emprestimo"
	format="ODT" jasper="Relatorio SPL - Emprestimo Simples"
	name="Relatorio SPL - ODT" />
<g:jasperReport action="createReportEmprestimoSimple" controller="emprestimo"
	format="DOCX" jasper="Relatorio SPL - Emprestimo Simples"
	name="Relatorio SPL - DOCX" />


<div align="center"><br></br>
<g:link action='search'>Pesquisar Novamente</g:link></div>
</body>
</html>